package com.lc.cehui.ui.activity;

import android.graphics.Color;
import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.hjq.bar.TitleBar;
import com.lc.cehui.R;
import com.lc.cehui.app.AppActivity;
import com.lc.cehui.ui.adapter.TabViewPagerAdapter;
import com.lc.cehui.ui.fragment.ResumeReceivedFragment;
import com.lc.cehui.ui.fragment.release.ReleaseFragment1;
import com.lc.cehui.ui.fragment.release.ReleaseFragment2;
import com.lc.cehui.ui.fragment.release.ReleaseFragment3;
import com.lc.cehui.ui.fragment.release.ReleaseFragment4;
import com.lc.cehui.ui.fragment.release.ReleaseFragment5;
import com.lc.cehui.widget.SlidingTabLayout;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ResumeReceivedActivity extends AppActivity {

    @BindView(R.id.titleBar)
    TitleBar titleBar;
    @BindView(R.id.sliding_tabs)
    SlidingTabLayout slidingTabs;
    @BindView(R.id.vp)
    ViewPager vp;


    private ArrayList<Fragment> fragments;
    private ArrayList<String> relist;//目录

    @Override
    protected boolean isStatusBarEnabled() {
        return true;
    }

    @Override
    public boolean isStatusBarDarkFont() {
        return false;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_resume_received;
    }

    @Override
    protected void initView() {
        relist = new ArrayList<>();

        fragments = new ArrayList<>();
        fragments.add(ResumeReceivedFragment.newInstance("0"));
        fragments.add(ResumeReceivedFragment.newInstance("1"));
        fragments.add(ResumeReceivedFragment.newInstance("2"));
        fragments.add(ResumeReceivedFragment.newInstance("3"));
        fragments.add(ResumeReceivedFragment.newInstance("4"));
        fragments.add(ResumeReceivedFragment.newInstance("5"));


        relist.add(" 全部 ");
        relist.add("未处理");
        relist.add(" 合适 ");
        relist.add(" 待定 ");
        relist.add("待面试");
        relist.add("不合适");


        vp.setAdapter(new TabViewPagerAdapter(this.getSupportFragmentManager(), ResumeReceivedActivity.this,fragments,relist));
        slidingTabs.setTabTitleTextSize(13);//标题字体大小
        slidingTabs.setTitleTextColor(Color.parseColor("#028BFF"), Color.parseColor("#999999"));//标题字体颜色
        slidingTabs.setTabStripWidth(100);//滑动条宽度
        slidingTabs.setSelectedIndicatorColors(Color.parseColor("#028BFF"));//滑动条颜色
        slidingTabs.setDistributeEvenly(true); //均匀平铺选项卡
        slidingTabs.setViewPager(vp);//最后调用此方法
        vp.setOffscreenPageLimit(fragments.size());//fragment保存的个数
        vp.setCurrentItem(getIntent().getIntExtra("comfrom",0));//设置卡在页面
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}